<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="page" tagdir="/WEB-INF/tags"%>
<!DOCTYPE html>
<html lang="en">
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>Board List</title>
    <link rel="stylesheet" type="text/css" href="<c:url value="/CSS/board/boardList.css"/>"/>
  </head>
  <body>
    <div class="container">
      <jsp:include page="/WEB-INF/JSP/head.jsp"/>
      <div class="body">
        <div class="board-list">
          <div class="caption">
            <div class="title">Board List - Board Management</div>
            <div class="add-board"><a href="javascript:" onclick="javascript:openWindow('<c:url value="/board/addBoard"/>', 600, 320)">Add Board</a></div>
          </div>
          <div class="tr1">
            <div class="td1">Name</div>
            <div class="td2">Description</div>
            <div class="td3">Update</div>
            <div class="td4">Delete</div>
          </div>
          <c:if test="${pagedBoards.list != null}">
            <c:forEach var="board" items="${pagedBoards.list}" varStatus="status">
              <div class="tr2" id="row_${status.index}" 
                onmouseover="toggleBackground('row_${status.index}', 0)" 
                onmouseout="toggleBackground('row_${status.index}', 1)">
                <div class="td1">${board.boardName}</div>
                <div class="td2"><a href="javascript:" onclick="javascript:openWindow('<c:url value="/board/boardDetail/${board.boardId}"/>', 600, 320)">${board.description}</a></div>
                <div class="td3"><a href="javascript:" onclick="javascript:openWindow('<c:url value="/board/updateBoard-${board.boardId}"/>', 600, 320)">Update</a></div>
                <div class="td4"><a href="javascript:" onclick="javascript:openWindow('<c:url value="/board/deleteBoard-${board.boardId}"/>', 600, 320)">Delete</a></div>
              </div>
            </c:forEach>
          </c:if>
          <div id="page">
            <page:PageBar pageURL="/board/boardList" pageAttrKey="pagedBoards"></page:PageBar>
          </div>
        </div>
      </div>
      <jsp:include page="/WEB-INF/JSP/foot.jsp"/>
    </div>
    <script type="text/javascript" src="<c:url value="/JS/jquery-1.7.2.min.js"/>"></script>
    <script type="text/javascript" src="<c:url value="/JS/jcommon.js"/>"></script>
  </body>
</html>